﻿CREATE PROCEDURE [dbo].[AddSecurityRole]
	@Model uniqueidentifier,
    @RoleId uniqueidentifier,
    @Name nvarchar(50),
	@IsDeleted bit,
    @CreatedBy uniqueidentifier,
	@CreatedOn datetime,
    @LastChanged datetime,
	@LastChangedBy uniqueidentifier,

	@TimeStamp timestamp output

AS

	INSERT INTO SecurityRole 

	(Model, RoleId, Name, IsDeleted, CreatedBy, CreatedOn, LastChanged, LastChangedBy)

	VALUES 

	(@Model, @RoleId, @Name, @IsDeleted, @CreatedBy, @CreatedOn, @LastChanged,@LastChangedBy)

	SELECT @TimeStamp = [TimeStamp]

	FROM SecurityRole WHERE RoleId=@RoleId

RETURN 0